class Solution:
    def hasSameDigits(self, s: str) -> bool:
        while len(s) > 2:
            temp = [0] * (len(s) - 1)
            for i in range(1, len(s)):
                item = (int(s[i]) + int(s[i - 1])) % 10
                temp[i - 1] = item
            s = temp
        if s[0] == s[1]:
            return True
        else:
            return False